#ifndef __FACADE_H__
#define __FACADE_H__
#include<iostream>
#include <string>
#include <memory>

class Borrow{
public:
    virtual void borrowBooks(const std::string& name) = 0;
};

class Query{
public:
    virtual bool queryBooks(const std::string& name) = 0;
};

class Return{
public:
    virtual void returnBooks(const std::string& name) = 0;
};

class BorrowSubSystem : public Borrow{
public:
    virtual void borrowBooks(const std::string& name){
        std::cout << "borrow <" << name << "> from story." << std::endl; 
    }
};

class QuerySubsystem : public Query{
public:
    virtual bool queryBooks(const std::string& name)
    {
        std::cout << "query <" << name << "> from system." << std::endl; 
        return true;
    }
};
class ReturnSubSystem : public Return{
public:
    virtual void returnBooks(const std::string& name){
        std::cout << "return <" << name << "> to system." << std::endl; 
    }
};

class LibraryFacade{
public:
    LibraryFacade();
    ~LibraryFacade()=default;
    void BorrowBooks(std::string name);
    void ReturnBooks(std::string name);

private:
    std::unique_ptr<BorrowSubSystem> m_borrowSubSys;
    std::unique_ptr<QuerySubsystem> m_querySubSys;
    std::unique_ptr<ReturnSubSystem> m_returnSubSys;
};

#endif